import java.util.Scanner;
import java.lang.*;
public class Main {
    int n;
    int[][] a;
    public static void main(String[] args) {
        Main ab = new Main();
        ab.solution();
    }
    public void solution(){
        Scan();
        for(int i =0;i<n;i++){
            int x1 = a[i][0];
            int x2= a[i][1];

            int x = tongceng(x1,x2);
            if(x==0){
                print(x1,x2);
            }
            if(x<0){
                while(x!=-1){
                    x2=x2/2;
                    x++;
                }
                if(x2-x1*2==0){
                    System.out.println("YES");
                }else if(x2-x1*2==1){
                    System.out.println("NO");
                }else{
                    x2=x2/2;
                    print(x1,x2);
                }
            }
            if (x > 0) {
                while(x!=1){
                    x1 =x1/2;
                    x--;
                }
                if(x1-x2*2==0){
                    System.out.println("NO");
                }else if(x1-x2*2==1){
                    System.out.println("YES");
                }else{
                    x1=x1/2;
                    print(x1,x2);
                }
            }
        }
    }
    public void print(int x1,int x2){
        if(x1<=x2){
            System.out.println("NO");
        }else{
            System.out.println("YES");
        }
    }
    public void Scan(){
        Scanner s =new Scanner(System.in);
        if(s.hasNextInt()){
             n=s.nextInt();
        }
        a = new int[n][2];
        for(int i =0;i<n;i++){
            if(s.hasNextInt()){
                a[i][0]=s.nextInt();
            }
            if (s.hasNextInt()){
                a[i][1] = s.nextInt();
            }
        }

    }
    int tongceng(int i,int j){
        int c1=i;
        int c2=j;
        int ceng1=0;
        int ceng2=0;
        while(c1!=0){
            c1=c1>>1;
            ceng1++;
        }
        while(c2!=0){
            c2=c2>>1;
            ceng2++;
        }
        return ceng1-ceng2;
    }


}
